<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>demo</title>
    <script>
        /**
         * 隐式原型指向
         */
        function A() {
            
        }
        
        A.prototype.age = 18
        
        var a = new A();
        
        A.prototype = {
            age:20,
            name:'dbb'
        }
        
        var aa = new A();
        
        console.log(a.age, a.name);
        console.log(aa.age, aa.name);

        /**
         * 
         */
        var F = function () {
            
        }
        
        Object.prototype.a = function () {
            console.log("a()")
        }
        
        Function.prototype.b = function () {
            console.log("b()")
        }
        
        var f = new F();
        f.a(); // a
        // f.b(); 执行出错 // a
        F.a(); // a
        F.b(); // b
        
    </script>
</head>
<body>
    
</body>
</html>
